package 剑指Offer._1120;

import general_class.ListNode;

/**
 * @author yzh
 * @version 1.0
 * @date 2021/7/25 14:54
 * 删除链表的节点
 * 算法；链表(链表一般使用递归来做)
 */
public class _18 {

    public ListNode deleteNode(ListNode head, int val) {
        if (null == head) return null;
        if (head.val == val) return head.next;
        head.next = deleteNode(head.next, val);
        return head;
    }

}
